﻿namespace Webinator.MultipleAttribute
{
    using Enums;

    /// <summary>
    /// Defines an attribute and its value.
    /// </summary>
    internal class DefineAttribute
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DefineAttribute"/> class.
        /// </summary>
        public DefineAttribute()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DefineAttribute"/> class.
        /// </summary>
        /// <param name="attributeIs">The attribute to look for.</param>
        public DefineAttribute(string customAttribute)
        {
            AttributeIs = AttributeIs.Custom;
            CustomAttribute = customAttribute;
            Exists = true;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DefineAttribute"/> class.
        /// </summary>
        /// <param name="attributeIs">The attribute to look for.</param>
        /// <param name="value">The value.</param>
        public DefineAttribute(AttributeIs attributeIs, string value)
        {
            AttributeIs = attributeIs;
            Value = value;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DefineAttribute"/> class.
        /// </summary>
        /// <param name="attributeIs">The attribute to look for.</param>
        /// <param name="value">The value.</param>
        /// <param name="contains">Indicates whether the attribute value should be an exact match.</param>
        public DefineAttribute(AttributeIs attributeIs, string value, bool contains)
        {
            AttributeIs = attributeIs;
            Value = value;
            Contains = contains;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DefineAttribute"/> class.
        /// </summary>
        /// <param name="customAttribute">The attribute to look for.</param>
        /// <param name="value">The value.</param>
        public DefineAttribute(string customAttribute, string value)
        {
            AttributeIs = AttributeIs.Custom;
            CustomAttribute = customAttribute;
            Value = value;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DefineAttribute"/> class.
        /// </summary>
        /// <param name="customAttribute">The attribute to look for.</param>
        /// <param name="value">The value.</param>
        /// <param name="contains">Indicates whether the attribute value should be an exact match.</param>
        public DefineAttribute(string customAttribute, string value, bool contains)
        {
            AttributeIs = AttributeIs.Custom;
            CustomAttribute = customAttribute;
            Value = value;
            Contains = contains;
        }

        /// <summary>
        /// Gets or sets the attribute to look for.
        /// </summary>
        public AttributeIs AttributeIs { get; set; }

        /// <summary>
        /// Gets or sets the custom attribute.
        /// </summary>
        public string CustomAttribute { get; set; }

        /// <summary>
        /// Gets or sets the desired value of the attribute.
        /// </summary>
        public string Value { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the attribute value should be an exact match.
        /// </summary>
        public bool Contains { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the attribute is included as an or statement.
        /// </summary>
        public bool Or { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the attribute only needs to exist
        /// </summary>
        public bool Exists { get; set; }
    }
}